package com.jetgege.convenientbox.Tools;

import android.graphics.Bitmap;
import android.widget.ImageView;

/**
 * Created by jetgege on 2017/3/12.
 */

public class Common {

    public static void setBgBlur(ImageView imageView,Bitmap originBitmap)
    {
        int scaleRatio = 30;
        int blurRadius = 8;

        Bitmap scaledBitmap = Bitmap.createScaledBitmap(originBitmap,
                originBitmap.getWidth() / scaleRatio,
                originBitmap.getHeight() / scaleRatio,
                false);
        Bitmap blurBitmap = FastBlurUtil.doBlur(scaledBitmap, blurRadius, true);
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        imageView.setImageBitmap(blurBitmap);
    }

}
